package com.lqr.wechat.fragment;

import android.content.Intent;
import android.view.View;

import com.bridge.imconfig.IMConst;
import com.bridge.imconfig.base.BaseFragment;
import com.lqr.wechat.R;
import com.lqr.wechat.activity.NearbyPerpleActivity;
import com.lqr.wechat.activity.ScanActivity;
import com.lqr.wechat.activity.WebViewActivity;
import com.lqr.wechat.databinding.FragmentDiscoveryBinding;

/**
 * @创建者 CSDN_LQR
 * @描述 发现
 */
public class DiscoveryFragment extends BaseFragment {

    private Intent mIntent;
    private FragmentDiscoveryBinding binding ;

    @Override
    protected int layoutId() {
        return R.layout.fragment_discovery;
    }

    @Override
    protected void initView(View view) {
        binding = getBind() ;
    }

    @Override
    public void initDataData() {

    }

    @Override
    protected void initListener() {
        binding.oivScan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getActivity(), ScanActivity.class));
            }
        });
        binding.oivNearby.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getActivity(), NearbyPerpleActivity.class));
            }
        });
        binding.oivShop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mIntent = new Intent(getActivity(), WebViewActivity.class);
                mIntent.putExtra("url", IMConst.Url.SHOP);
                mIntent.putExtra("title", "京东购物");
                startActivity(mIntent);
            }
        });
        binding.oivGame.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mIntent = new Intent(getActivity(), WebViewActivity.class);
                mIntent.putExtra("url", IMConst.Url.GAME);
                mIntent.putExtra("title", "微信游戏");
                startActivity(mIntent);
            }
        });
    }
}
